home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Samples / SampleCode / Unsupported Libraries / CustomAttribute_Lib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-14  |  2.1 KB  |  118 lines  |  [TEXT/MPS ]

  1. #ifndef __CUSTOMATTRIBUTE_LIB__
  2. #define __CUSTOMATTRIBUTE_LIB__
  3.  
  4. /* make old picking code work */
  5. #if !defined(QD3D_OBSOLETE)
  6. #define QD3D_OBSOLETE    1
  7. #endif
  8.  
  9. #ifndef QD3D_h
  10. #include <QD3D.h>
  11. #endif
  12.  
  13. #ifndef QD3DPick_h
  14. #include <QD3DPick.h>
  15. #endif
  16.  
  17. #ifndef _STRING
  18. #include <string.h>
  19. #endif
  20.  
  21. /* Here we define the new types */
  22.  
  23. #define kElementTypeName                'name'
  24. #define kElementTypeScale                'scle'
  25. #define kElementTypeUpVector            'upvt'
  26. #define kElementTypeForwardDirection    'fwrd'
  27. #define kElementTypeW3Anchor            'w3nr'
  28. #define kElementTypeW3Inline            'w3nl'
  29.  
  30. typedef enum W3AnchorOptions {
  31.     kW3AnchorOptionNone            =  0,
  32.     kW3AnchorOptionUseMap        =  1
  33. } W3AnchorOptions;
  34.  
  35. typedef struct W3AnchorData {
  36.     char                *url;
  37.     TQ3StringObject        description;
  38.     W3AnchorOptions    options;
  39. } W3AnchorData;
  40.  
  41. typedef struct W3InlineData {
  42.     char                *url;
  43. } W3InlineData;
  44.  
  45. /*
  46.  *    Call this to register all the custom attributes
  47.  *    
  48.  *    One call does it all
  49.  */
  50. #ifdef __cplusplus
  51. extern "C" {
  52. #endif    /* __cplusplus */
  53.  
  54. void RegisterAllCustomAttributes(void);
  55.  
  56. void UnregisterAllCustomAttributes(void);
  57.  
  58. /*
  59.  *    Convenience routines for setting elements
  60.  *    
  61.  */
  62.  
  63. TQ3Status SetName(
  64.     TQ3Object    object,
  65.     char        *name);
  66.  
  67. TQ3Status SetScale(
  68.     TQ3Object    object,
  69.     double        scale);
  70.  
  71. TQ3Status SetUpVector(
  72.     TQ3Object    object,
  73.     TQ3Vector3D    *upVector);
  74.  
  75. TQ3Status SetForwardDirection(
  76.     TQ3Object    object,
  77.     TQ3Vector3D    *forwardDirection);
  78.  
  79. TQ3Status SetW3Anchor(
  80.     TQ3Object            object,
  81.     char                *url,
  82.     char                *description,
  83.     W3AnchorOptions options);
  84.     
  85. TQ3Status SetW3Inline(
  86.     TQ3Object    object,
  87.     char        *url);
  88.     
  89. TQ3Boolean W3Anchor_GetFromObject(
  90.     TQ3Object object,
  91.     W3AnchorData *data);
  92.  
  93. TQ3Boolean W3Anchor_GetFromHitData(
  94.     const TQ3HitData *hitData, 
  95.     W3AnchorData *data);
  96.     
  97. void W3Anchor_Empty (
  98.     W3AnchorData *URLData);
  99.  
  100.  
  101. #ifdef __cplusplus
  102. }
  103. #endif  /*  __cplusplus  */
  104.  
  105. /*
  106.  *    Note
  107.  *    
  108.  *    kElementNameWWWAnchor is obsolete and has been replaced by kElementW3Anchor.
  109.  */
  110. #define kElementTypeWWWAnchor    ((TQ3ElementType) Q3_OBJECT_TYPE('w','w','w','a'))
  111. #define kElementNameWWWAnchor    "WWWAnchor"
  112.  
  113. typedef struct WWWAnchorData {
  114.     char    *url;
  115. } WWWAnchorData;
  116.  
  117. #endif
  118.